linalg_lq Module



Interfaces

public interface form_lq

  • private subroutine form_lq_no_pivot(l, tau, q, work, olwork, err)

    Forms the orthogonal matrix from the elementary reflectors returned by the LQ factorization algorithm.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(inout), dimension(:,:) :: l

    On input, an M-by-N matrix where the elements above the diagonal contain the elementary reflectors generated from the LQ factorization performed by lq_factor. On and below the diagonal the matrix contains the matrix . On output, the elements above the diagonal are zeroed sucht hat the remaining matrix is the M-by-N lower trapezoidal matrix where only the M-by-M submatrix is the lower triangular matrix . Notice, M must be less than or equal to N for this routine.

    real(kind=real64), intent(in), dimension(:) :: tau

    A MIN(M, N)-element array containing the scalar factors of each elementary reflector defined in .

    real(kind=real64), intent(out), dimension(:,:) :: q

    An N-by-N matrix where the orthogonal matrix will be written.

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine form_lq_no_pivot_cmplx(l, tau, q, work, olwork, err)

    Forms the orthogonal matrix from the elementary reflectors returned by the LQ factorization algorithm.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(inout), dimension(:,:) :: l

    On input, an M-by-N matrix where the elements above the diagonal contain the elementary reflectors generated from the LQ factorization performed by lq_factor. On and below the diagonal the matrix contains the matrix . On output, the elements above the diagonal are zeroed sucht hat the remaining matrix is the M-by-N lower trapezoidal matrix where only the M-by-M submatrix is the lower triangular matrix . Notice, M must be less than or equal to N for this routine.

    complex(kind=real64), intent(in), dimension(:) :: tau

    A MIN(M, N)-element array containing the scalar factors of each elementary reflector defined in .

    complex(kind=real64), intent(out), dimension(:,:) :: q

    An N-by-N matrix where the orthogonal matrix will be written.

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

public interface lq_factor

  • private subroutine lq_factor_no_pivot(a, tau, work, olwork, err)

    Computes the LQ factorization of an M-by-N matrix where is a lower triangular (or lower trapezoidal) matrix and is a orthogonal matrix.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(inout), dimension(:,:) :: a

    On input, the M-by-N matrix to factor. On output, the elements on and below the diagonal contain the MIN(M, N)-by-N lower trapezoidal matrix ( is lower triangular if M >= N). The elements above the diagonal, along with the array tau, represent the orthogonal matrix as a product of elementary reflectors.

    real(kind=real64), intent(out), dimension(:) :: tau

    A MIN(M, N)-element array used to store the scalar factors of the elementary reflectors.

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine lq_factor_no_pivot_cmplx(a, tau, work, olwork, err)

    Computes the LQ factorization of an M-by-N matrix where is a lower triangular (or lower trapezoidal) matrix and is a orthogonal matrix.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(inout), dimension(:,:) :: a

    On input, the M-by-N matrix to factor. On output, the elements on and below the diagonal contain the MIN(M, N)-by-N lower trapezoidal matrix ( is lower triangular if M >= N). The elements above the diagonal, along with the array tau, represent the orthogonal matrix as a product of elementary reflectors.

    complex(kind=real64), intent(out), dimension(:) :: tau

    A MIN(M, N)-element array used to store the scalar factors of the elementary reflectors.

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

public interface mult_lq

  • private subroutine mult_lq_mtx(lside, trans, a, tau, c, work, olwork, err)

    Multiplies a matrix by the orthogonal matrix from an LQ factorization.

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: lside

    Set to true to compute ; else, set to false to compute .

    logical, intent(in) :: trans

    Set to true to compute ; else, set to false to compute .

    real(kind=real64), intent(in), dimension(:,:) :: a

    On input, an K-by-P matrix containing the elementary reflectors output from the LQ factorization. If lside is set to true, P = M; else, if lside is set to false, P = N.

    real(kind=real64), intent(in), dimension(:) :: tau

    A K-element array containing the scalar factors of each elementary reflector defined in a.

    real(kind=real64), intent(inout), dimension(:,:) :: c

    On input, the M-by-N matrix C. On output, the product of the orthogonal matrix Q and the original matrix C.

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine mult_lq_mtx_cmplx(lside, trans, a, tau, c, work, olwork, err)

    Multiplies a matrix by the orthogonal matrix from an LQ factorization.

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: lside

    Set to true to compute ; else, set to false to compute .

    logical, intent(in) :: trans

    Set to true to compute ; else, set to false to compute .

    complex(kind=real64), intent(in), dimension(:,:) :: a

    On input, an K-by-P matrix containing the elementary reflectors output from the LQ factorization. If lside is set to true, P = M; else, if lside is set to false, P = N.

    complex(kind=real64), intent(in), dimension(:) :: tau

    A K-element array containing the scalar factors of each elementary reflector defined in a.

    complex(kind=real64), intent(inout), dimension(:,:) :: c

    On input, the M-by-N matrix C. On output, the product of the orthogonal matrix Q and the original matrix C.

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine mult_lq_vec(trans, a, tau, c, work, olwork, err)

    Multiplies a vector with the orthogonal matrix from an LQ factorization such that .

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: trans

    Set to true to compute ; else, set to false to compute .

    real(kind=real64), intent(in), dimension(:,:) :: a

    On input, an K-by-M matrix containing the elementary reflectors output from the LQ factorization. Notice, the contents of this matrix are restored on exit.

    real(kind=real64), intent(in), dimension(:) :: tau

    A K-element array containing the scalar factors of each elementary reflector defined in a.

    real(kind=real64), intent(inout), dimension(:) :: c

    On input, the M-element vector . On output, the product of the orthogonal matrix and the original vector .

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine mult_lq_vec_cmplx(trans, a, tau, c, work, olwork, err)

    Multiplies a vector with the orthogonal matrix from an LQ factorization such that .

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: trans

    Set to true to compute ; else, set to false to compute .

    complex(kind=real64), intent(in), dimension(:,:) :: a

    On input, an K-by-M matrix containing the elementary reflectors output from the LQ factorization. Notice, the contents of this matrix are restored on exit.

    complex(kind=real64), intent(in), dimension(:) :: tau

    A K-element array containing the scalar factors of each elementary reflector defined in a.

    complex(kind=real64), intent(inout), dimension(:) :: c

    On input, the M-element vector . On output, the product of the orthogonal matrix and the original vector .

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

public interface solve_lq

  • private subroutine solve_lq_mtx(a, tau, b, work, olwork, err)

    Solves a system of LQ factored equations of the form .

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:) :: a

    On input, the M-by-N LQ factored matrix as returned by lq_factor.
    On output, the contents of this matrix are restored. Notice, N must be greater than or equal to M.

    real(kind=real64), intent(in), dimension(:) :: tau

    A MIN(M, N)-element array containing the scalar factors of the elementary reflectors as returned by lq_factor.

    real(kind=real64), intent(inout), dimension(:,:) :: b

    On input, an N-by-NRHS matrix where the first M rows contain the right-hand-side matrix . On output, the N-by-NRHS solution matrix .

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private module subroutine solve_lq_mtx_cmplx(a, tau, b, work, olwork, err)

    Solves a system of LQ factored equations of the form .

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(in), dimension(:,:) :: a

    On input, the M-by-N LQ factored matrix as returned by lq_factor.
    On output, the contents of this matrix are restored. Notice, N must be greater than or equal to M.

    complex(kind=real64), intent(in), dimension(:) :: tau

    A MIN(M, N)-element array containing the scalar factors of the elementary reflectors as returned by lq_factor.

    complex(kind=real64), intent(inout), dimension(:,:) :: b

    On input, an N-by-NRHS matrix where the first M rows contain the right-hand-side matrix . On output, the N-by-NRHS solution matrix .

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine solve_lq_vec(a, tau, b, work, olwork, err)

    Solves a system of LQ factored equations of the form .

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:) :: a

    !! On input, the M-by-N LQ factored matrix as returned by lq_factor.
    On output, the contents of this matrix are restored. Notice, N must be greater than or equal to M.

    real(kind=real64), intent(in), dimension(:) :: tau

    A MIN(M, N)-element array containing the scalar factors of the elementary reflectors as returned by lq_factor.

    real(kind=real64), intent(inout), dimension(:) :: b

    On input, an N-element vector where the first M rows contain the right-hand-side vector . On output, the N-element vector .

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine solve_lq_vec_cmplx(a, tau, b, work, olwork, err)

    Solves a system of LQ factored equations of the form .

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(in), dimension(:,:) :: a

    !! On input, the M-by-N LQ factored matrix as returned by lq_factor.
    On output, the contents of this matrix are restored. Notice, N must be greater than or equal to M.

    complex(kind=real64), intent(in), dimension(:) :: tau

    A MIN(M, N)-element array containing the scalar factors of the elementary reflectors as returned by lq_factor.

    complex(kind=real64), intent(inout), dimension(:) :: b

    On input, an N-element vector where the first M rows contain the right-hand-side vector . On output, the N-element vector .

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.